package com.reminiscence.main;

import java.util.ArrayList;
import java.util.HashMap;

import org.apache.http.NameValuePair;

import android.app.Activity;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.SimpleAdapter;

import com.reminiscence.database.OperazioniDB;

public class ListaSuggerimenti extends Activity
{

	public static ArrayList<HashMap<String, String>> listaSuggerimenti = new ArrayList<HashMap<String, String>>();
	
	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.lista_suggerimenti);
		setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
		
		ArrayList<NameValuePair> params = new ArrayList<NameValuePair>();

		Boolean ret = false; 
		try
		{
			ret =  (Boolean)(new OperazioniDB(this, "listaSuggerimenti", params).execute().get());
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
		
		ListView lw = (ListView)findViewById(R.id.lstSuggerimenti);
		lw.setAdapter(null);
		
		ListAdapter adapter = new SimpleAdapter
				(
					this, listaSuggerimenti,
					R.layout.list_item_suggerimenti,
					new String[]
					{
					
						"Testo",
						
					},
					new int[]
					{
							
						
						R.id.txtSuggerimento,
		        	
		    		}
				);

				lw.setAdapter(adapter);
		
	}
	
}